package com.ibeeking.found.msg.rest.controller.v1;

import com.ibeeking.found.msg.rest.service.IWxMpAutoMessageKeyService;
import com.ibeeking.found.msg.service.common.param.WxMpAutoMessageKeyParam;
import com.ibeeking.found.msg.service.common.query.WxMpAutoMessageKeyPageQuery;
import com.ibeeking.found.msg.service.common.query.WxMpAutoMessageKeyQuery;
import com.ibeeking.found.msg.service.common.vo.WxMpAutoMessageKeyVO;
import com.ibeeking.nematos.constants.enums.OperateLogTypeEnum;
import com.ibeeking.nematos.log.annotation.Log;
import com.ibeeking.nematos.utils.base.BaseValidationGroup;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.List;

/**
 * 自动消息回复配置，关键字类型回复 配置关键字
 * @ClassName WxmpAutoMessageKeyController控制器
 * @Description
 * @Author ibeeking
 * @Date 2021-02-05 19:10
 **/
@Deprecated
@RestController
@RequestMapping("/b/wxMp/autoMsgKeyword/v1")
public class WxMpAutoMessageKeyController {

    @Resource
    private IWxMpAutoMessageKeyService wxMpAutoMessageKeyServiceImpl;

    @Log(logType = OperateLogTypeEnum.QUERY, describe = "")
    @PostMapping(value = "/list")
    public List<WxMpAutoMessageKeyVO> list(@RequestBody WxMpAutoMessageKeyQuery query) {
        return wxMpAutoMessageKeyServiceImpl.list(query);
    }

    @Log(logType = OperateLogTypeEnum.QUERY, describe = "")
    @PostMapping(value = "/pageList")
    public Page<WxMpAutoMessageKeyVO> pageList(@RequestBody WxMpAutoMessageKeyPageQuery pageQuery) {
        return wxMpAutoMessageKeyServiceImpl.pageList(pageQuery);
    }

    @Log(logType = OperateLogTypeEnum.SAVE, describe = "")
    @PostMapping(value = "/add")
    public Boolean add(@RequestBody @Validated(BaseValidationGroup.Insert.class) WxMpAutoMessageKeyParam param) {
        return wxMpAutoMessageKeyServiceImpl.add(param);
    }

    @Log(logType = OperateLogTypeEnum.MODIFY, describe = "")
    @PostMapping(value = "/modify")
    public Boolean modify(@RequestBody @Validated(BaseValidationGroup.Update.class) WxMpAutoMessageKeyParam param) {
        return wxMpAutoMessageKeyServiceImpl.modify(param);
    }

    @Log(logType = OperateLogTypeEnum.QUERY, describe = "")
    @GetMapping(value = "/view/{id}")
    public WxMpAutoMessageKeyVO view(@PathVariable("id") Long id) {
        return wxMpAutoMessageKeyServiceImpl.view(id);
    }


    @Log(logType = OperateLogTypeEnum.DEL, describe = "")
    @GetMapping(value = "/del/{id}")
    public Boolean del(@PathVariable("id") Long id) {
        return wxMpAutoMessageKeyServiceImpl.del(id);
    }
}
